package yf.platform.biz;

import java.util.Map;

import yf.platform.bo.BizResult;


public class ControlService extends Service {

	
	public BizResult list(Map<String,String> input){
		
		return rst.setCode(0).setReqAttribute("controls", this.daoSupport.find("sys_control",null,null,null))
			.setType(BizResult.REDIRECT)
			.setPage("control/list.jsp");
	}
	
	public BizResult add(Map<String,String> input){
		int rows = this.daoSupport.insert( "sys_control",input);
		if(0 == rows){
			return list(input);
		}
		return rst.setCode(-101).setMsg("添加行数超出预期值,共影响了："+rows);
		
		
	}

	public BizResult del(Map<String,String> input){
		return rst.setType(BizResult.REDIRECT)
				.setCode(0)
				.setPage("model/add.jsp");
	}
	
	public BizResult addform(Map<String,String> input){
		return rst.setType(BizResult.JUMP)
				.setCode(0)
				.setPage("control/add.jsp");
	}
	
	public BizResult updform(Map<String,String> input){
		//TODO..获取值
		return rst.setType(BizResult.REDIRECT)
				.setCode(0)
				.setPage("model/upd.jsp");
	}
	
}
